Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Solves [Bug] #595 Setting TabView.SelectedIndex does not "visually" switch tabs #738

Merged
merged 6 commits into from
Feb 22, 2021

Conversation

Jon2G
Copy link
Contributor

@Jon2G Jon2G commented Jan 9, 2021

Setting TabView.SelectedIndex does not "visually" switch tabs

Description of Change

Solves setting TabView.SelectedIndex does not "visually" switch tabs
Adding oldPosition value to UpdateSelectedIndex function in UpdateSelectedIndex avoids the false true on
if (oldPosition == newPosition)

Bugs Fixed

#595

API Changes

None

Added:

  • Parameter oldPosition on TabView.shared.UpdateSelectedIndex

PR Checklist

  • Has tests (if omitted, state reason in description)
  • Has samples (if omitted, state reason in description)
  • Rebased on top of main at time of PR
  • Changes adhere to coding standard
  • Updated documentation

 Setting TabView.SelectedIndex does not "visually" switch tabs
@@ -745,12 +745,10 @@ bool CanUpdateSelectedIndex(int selectedIndex)
return true;
}

void UpdateSelectedIndex(int position, bool hasCurrentItem = false)
void UpdateSelectedIndex(int oldPosition, int position, bool hasCurrentItem = false)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it simpler perhaps, to validate the old and new index before invoking UpdateSelectedIndex?. Could you add an example where validate the fix?

@ghost ghost deleted a comment from dnfadmin Jan 14, 2021
Validate the old and new index before invoking UpdateSelectedIndex as suggested
@ghost
Copy link

ghost commented Jan 14, 2021

CLA assistant check
All CLA requirements met.

@jfversluis jfversluis added a/TabView bug Something isn't working. Breaky break. labels Jan 21, 2021
jfversluis
jfversluis previously approved these changes Jan 21, 2021
@jfversluis jfversluis added this to the v1.0.2 milestone Jan 21, 2021
@pictos pictos requested a review from jsuarezruiz January 26, 2021 02:03
@jfversluis
Copy link
Member

I think this is now solved by #903

@jfversluis jfversluis closed this Feb 16, 2021
@jfversluis
Copy link
Member

Maybe I was too quick on this 😬

@jfversluis jfversluis reopened this Feb 16, 2021
Fixes xamarin#595
Added simple test
Maybe related to xamarin#870
@Jon2G
Copy link
Contributor Author

Jon2G commented Feb 17, 2021

Example forked and updated from: @MauricioCodeguez
https://github.com/Jouna77/TabViewDemo
Sample

@jfversluis jfversluis merged commit 3abf5fa into xamarin:main Feb 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/TabView bug Something isn't working. Breaky break.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Setting TabView.SelectedIndex does not "visually" switch tabs
3 participants